from .base import Base
import json


class RebootGateway(Base):
    def __init__(self, data):
        super(RebootGateway, self).__init__(data)
        self.wait_num = 10

    def struct_msg(self):
        msg = {"TID": self.tid}
        msg = json.dumps(msg)
        return msg

    def struct_pub_topic(self):
        notify = "notify"
        gid = "".join(["/", self.gateway_id, "/"])
        func = "reboot"
        topic = "".join([notify, gid, func])
        return topic


    def struct_sub_topic(self):
        notify = "notifyed"
        gid = "".join(["/", self.gateway_id, "/"])
        func = "reboot"
        topic = "".join([notify, gid, func])
        return topic
